/*
https://leetcode.cn/problems/Uh984O/solution/by-wasser2545-2t7m/
 */
import java.util.Arrays;

public class SolutionLCP25 {

    private static final long mod = 1000000007;
    long[][] f;
    long[][] g;

    public int keyboard(int k, int n) {
        f=new long[n+1][n+1];
        for (int i=0;i<=n;i++){
            for (int j=0;j<=i;j++){
                if (j==i || j==0){
                    f[i][j]=1;
                }else {
                    f[i][j]=(f[i-1][j]+f[i-1][j-1])%mod;
                }
            }
        }
        g=new long[27][n+1];
        for (long[] longs : g) {
            Arrays.fill(longs, -1);
        }
        return (int)(dfs(26,k,n)%mod);
    }

    private long dfs(int t, int k, int n) {
        if (g[t][n]==-1){
            if (n==0){
                g[t][n]=1;
            }else
            if (t==0){
                g[t][n]=0;
            }else {
                g[t][n]=0;
                for (int i=0;i<=Math.min(k,n);i++){
                    g[t][n]=(g[t][n]+(f[n][i]*dfs(t-1,k,n-i))%mod)%mod;
                }
            }
        }
        return g[t][n];
    }

    public static void main(String[] args) {
        System.out.println(new SolutionLCP25().keyboard(1,2));
    }
}
